package com.gitee.huanminabc.utils_tools.security.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.huanminabc.utils_tools.security.enums.DelEnum;
import com.gitee.huanminabc.utils_tools.security.enums.EducationEnum;
import com.gitee.huanminabc.utils_tools.security.enums.SexEnum;
import com.gitee.huanminabc.utils_tools.security.enums.UserStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author huanmin
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "UserEntity",description = "")
@TableName("t_user")
public class UserEntity implements Serializable{
    private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "主键",required = true)
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "用户名",required = true)
	@TableField( "account")
	private String account;

	@ApiModelProperty(value = "昵称",required = false)
	@TableField( "nickName")
	private String nickName;

	@ApiModelProperty(value = "密码",required = true)
	@TableField( "password")
	private String password;

	@ApiModelProperty(value = "账号状态（0正常 1停用）",required = true)
	@TableField( "`status`")
	private UserStatusEnum status;

	@ApiModelProperty(value = "邮箱",required = false)
	@TableField( "email")
	private String email;

	@ApiModelProperty(value = "手机号",required = false)
	@TableField( "phoneNumber")
	private String phoneNumber;

	@ApiModelProperty(value = "用户性别（0男，1女，2未知）",required = true)
	@TableField( "`sex`")
	private SexEnum sex;

	@ApiModelProperty(value = "头像",required = false)
	@TableField( "avatar")
	private String avatar;

	@ApiModelProperty(value = "创建人的用户id, -1(管理员)",required = true)
	@TableField( "createBy")
	private Integer createBy;

	@ApiModelProperty(value = "创建时间",required = true)
	@TableField( value = "createTime")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	@ApiModelProperty(value = "更新人, -1(管理员操作)",required = true)
	@TableField( "updateBy")
	private String updateBy;

	@ApiModelProperty(value = "更新时间",required = true)
	@TableField(value = "updateTime")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;

	@ApiModelProperty(value = "删除标志（0代表未删除，1代表已删除）",required = true)
	@TableField( "delFlag")
	private DelEnum delFlag;


	@ApiModelProperty(value = "余额",required = true)
	@TableField("balance")
	private BigDecimal balance;

	@ApiModelProperty(value = "最高学历: -1未知,0博士,1研究生,2本科,3大专,4高中",required = true)
	@TableField("education")
	private EducationEnum education;

	@ApiModelProperty(value = "开始工作时间",required = false)
	@TableField("startWordTIme")
	private Date startWordTIme;

	@ApiModelProperty(value = "出生日期",required = false)
	@TableField("birthdate")
	private Date birthdate;

	@ApiModelProperty(value = "所在地区",required = false)
	@TableField("location")
	private String location;


	@ApiModelProperty(value = "个人简介",required = false)
	@TableField("`desc`")
	private String desc;




}
